{template 'common/header'}
<title>开业活动</title>
<style type="text/css">
    *{margin:auto;}
    body {margin:0; font-family:'微软雅黑'; background:#F0F0F0;}
    a:link,a:visited,a:active{color:#fff;text-decoration:none;}
    a:hover{color:#fff;text-decoration:none;}
    .title{width:100%;height:150px;}
    .title img{width:100%;height:100%;}
    .activity{width:80%;height:120px;}
    .gender{color:#6B6B6B;}
    .english{font-size:10px;color:#BFBFBF;}
    .jianjie{width:100%;height:80px;background:#fff;margin-top:10px;}
    .jianjie-img{width:30%;height:60px;float:left;margin-top:10px;margin-left:5%;}
    .jianjie-img img{width:100%;height:100%;border-radius:10px;}
    .detail{width:55%;height:60px;float:right;margin-top:10px;margin-right:5%;color:#8F8F8F;font-size:12px;}
    .submit{width:120px;height:30px;background:#FAC04F;color:#fff;font-size:16px;border-radius:20px;text-align:center;line-height:30px;margin-top:20px;}
</style>
<div class='title'><img src="../addons/ewei_shop/template/mobile/default/static/images/jiameng/activity.jpg"></div>
{loop $activity $key $row}
{if $key==0}
<input type="hidden" id="gender" value="{$row['id']}" />
{/if}
<div class="activity">
<span class="gender" data-val="{$row['id']}"><i {if $key==0}class="fa fa-check-circle-o" style="color:#0C9;"{else}class="fa fa-circle-o" style="color:#999;"{/if}></i>{$row['title']}</span>
<span class="english">ONE PROJECT</span>
<div class="jianjie">
    <div class="jianjie-img"><img src="http://oss-cn-shenzhen.aliyuncs.com/weixin-lanxue/{$row['image']}"></div>
    <div class="detail">{$row['about']}</div>
</div>
</div>
{/loop}
<div class="submit" id='submit'>提交</div>
<script language="javascript">
    $('.gender').click(function() {
        var $this = $(this);
        var val = $this.data('val');
        window.sex = val;
        $('.gender').find('i').css('color', '#999').removeClass('fa-check-circle-o').addClass('fa-circle-o');
        $(this).find('i').removeClass('fa-circle-o').addClass('fa-check-circle-o').css('color', '#0c9');
        $('#gender').val(val);
    })
</script>
<script language="javascript">
    require(['tpl', 'core'], function(tpl, core) {   
                            $('#submit').click(function(){
                               val=$('#gender').val();
                                core.json('franchise/center',{
                                    op:'activity_submit',
                                    activity_id:val
                                 },function(postjson){
                                     if(postjson.status==1){
                                        alert("提交成功！");
                                        $("#submit").html('提交').removeAttr('saving');
                                     }
                                     if(postjson.status==-1){
                                         core.tip.show('您已提交过，不能重复提交！'); 
                                         $("#submit").html('提交').removeAttr('saving');
                                     }
                                     if(postjson.status==0){
                                         core.tip.show('操作失败'); 
                                         $("#submit").html('提交').removeAttr('saving');
                                     }
                                },true,true);
                           }); 
    });
</script>
{template 'common/footer'}